#pragma once

#include "OglViewInterfaces.h"

#include "CollisionPrimitives.h"

#include "ScreenRayPicker.h"

#include <vector>

class MikeDrumTrackBuilder : public ICustomDraw, public ICustomOnMouse
{
	CollisionRect m_arrRectsCopyFrom[2];
	std::vector<CollisionRect> m_vecRects;

	int m_nSelectedRect;

	ICustomOnMouse * m_pMouseHandlerNext;

	const ScreenRayPicker * m_pRayPicker;

	inline int MaxRectsToCopy() { return 2;}

	UINT m_nFlagsLast;

	mdsRay<double> m_rayOld;
public:
	MikeDrumTrackBuilder(void);
	virtual ~MikeDrumTrackBuilder(void);

	void SetNextHandler(ICustomOnMouse & nextHandler)
	{
		m_pMouseHandlerNext = &nextHandler;
	}

	void SetRayPicker(const ScreenRayPicker & rayPicker) {m_pRayPicker = &rayPicker;}

	virtual void Draw();
	virtual bool OnMouseMove(UINT nFlags, double lfX, double lfY );
};
